--Drop database DBWebCrawler
create database DBWebCrawler
Go
Use DBWebCrawler
Go

create Table Web ( 
	IDWeb int IDENTITY  NOT NULL primary key, 
	TenWeb nvarchar (128),
	TenDomain nvarchar (128)
) 

create Table ChuyenMuc
( 
	IDChuyenmuc int IDENTITY  NOT NULL primary key, 
	IDWeb int , 
	TenChuyenMuc nvarchar (128),
	Xpath_link nvarchar (256),
	Xpath_title nvarchar (256),
	Xpath_img nvarchar (256),
	Xpath_time nvarchar(256),
	Xpath_content nvarchar(256),
	Xpath_next nvarchar(256),
	url nvarchar(256)
) 

create Table NoiDung
( 
	IDNoiDung int IDENTITY  NOT NULL primary key,
	IDChuyenMuc int, 
	link nvarchar (1024),
	TenTitTle nvarchar (1024),
	HinhAnh  image, 
	ThoiGian nvarchar (1024), 
	NoiDung  nvarchar (1024)
)

insert into Web(TenWeb) values ('abc')
insert into Web(TenWeb) values ('cde')

insert into ChuyenMuc(IDWeb,TenChuyenMuc) values (1,'mothaiba')
insert into ChuyenMuc(IDWeb,TenChuyenMuc) values (1,'bon5sau')

insert into NoiDung(IDChuyenMuc,TenTitTle,Thoigian,HinhAnh,NoiDung) values (1,'XinChao','10/26/1990','Awesome Universe.jpg','Test thu du lieu')
insert into NoiDung(IDChuyenMuc,TenTitTle,Thoigian,HinhAnh,NoiDung) values (1,'XinChao2','10/26/1990','Awesome Universe.jpg','Test thu du lieu2')
insert into NoiDung(IDChuyenMuc,TenTitTle,Thoigian,HinhAnh,NoiDung) values (1,'XinChao3','10/26/1990','Awesome Universe.jpg','Test thu du lieu3')
insert into NoiDung(IDChuyenMuc,TenTitTle,Thoigian,HinhAnh,NoiDung) values (1,'XinChao','10/26/1990','Awesome Universe.jpg','Test thu du lieu')
insert into NoiDung(IDChuyenMuc,TenTitTle,Thoigian,HinhAnh,NoiDung) values (1,'XinChao2','10/26/1990','Awesome Universe.jpg','Test thu du lieu2')
insert into NoiDung(IDChuyenMuc,TenTitTle,Thoigian,HinhAnh,NoiDung) values (1,'XinChao3','10/26/1990','Awesome Universe.jpg','Test thu du lieu3')
insert into NoiDung(IDChuyenMuc,TenTitTle,Thoigian,HinhAnh,NoiDung) values (1,'XinChao','10/26/1990','Awesome Universe.jpg','Test thu du lieu')
insert into NoiDung(IDChuyenMuc,TenTitTle,Thoigian,HinhAnh,NoiDung) values (1,'XinChao2','10/26/1990','Awesome Universe.jpg','Test thu du lieu2')
insert into NoiDung(IDChuyenMuc,TenTitTle,Thoigian,HinhAnh,NoiDung) values (1,'XinChao3','10/26/1990','Awesome Universe.jpg','Test thu du lieu3')
insert into NoiDung(IDChuyenMuc,TenTitTle,Thoigian,HinhAnh,NoiDung) values (2,'XinChao 2','10/26/1990','Awesome Universe.jpg','Test thu du lieu 2')